﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manager/Base.Master" AutoEventWireup="true" CodeBehind="MessageList.aspx.cs" Inherits="YXQ.Manager.Manager.MessageList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <script type="text/javascript">
         $(function () {
             $('#dg').datagrid({
                 title: '信息列表',
                 iconCls: 'icon icon-nav',
                 height: 400,
                 nowrap: true,
                 autoRowHeight: false,
                 striped: true,
                 url: "../Handler/DataHandler.ashx?OpType=GetMessage",
                 sortOrder: 'desc',
                 remoteSort: false,
                 pagination: true,
                 columns: [[
                         { field: 'Id', title: 'ID', width: 80 },
                         { field: 'qname', title: '标题', width: 150 },
                         { field: 'createusername', title: '创建者', width: 150 },
                         { field: 'createtime', title: '创建时间', width: 200 }, 
                       
                         {
                             field: 'opt', title: '操作', width: 200, align: 'center',
                             formatter: function (value, rec) {

                                 return "<a href='javascript:' onclick='Edit(" + rec.Id + ")'>编辑</a>&nbsp;&nbsp;<a href='javascript:' onclick='Del(" + rec.Id + ")'>删除</a>";
                             }
                         }
                 ]],
                 toolbar: [{
                     id: 'btnadd',
                     text: '添加',
                     iconCls: 'icon-add',
                     handler: function () {
                         YXQ.Manager.OpenDialog("MessageDetail.aspx", "添加信息", 600,300);
                     }
                 }]


             });

         });
         function Edit(val) {
             YXQ.Manager.OpenDialog("MessageDetail.aspx?id=" + val, "修改信息", 600, 300);
         }
         function IsUsedFormat(val) {
             var rtn = "";
             if (val == "0") {
                 rtn = "否";
             } else {
                 rtn = "<font color='red'>是</font>";
             }
             return rtn;
         }

         function Del(val) {
             YXQCore.Form.PostData("../Handler/CommonHandler.ashx",
                                 { OpType: "DelMsg", PostData: val },
                                 function (data) { 
                                     if (data.ResultMessage == "Success") {
                                         YXQ.Common.Message("恭喜你操作已经成功");
                                         $("#dg").datagrid("reload");
                                         return;
                                     }

                                 });
         }
</script>
     <table cellspacing="0" cellpadding="0" width="100%" class="admintable">
        <tr>
            <td>
                <table cellspacing="0" cellpadding="0" class="admintable01">
                    <tr>
                        <td style="width: 20px;">
                            <img src="../images/carfromtable_01.gif" style="margin-top: 2px;" />
                        </td>
                        <td>
                            <b>位置：</b>信息列表
                        </td>
                        <td style="width: 50px;"></td>
                        <td style="width: 50px;"></td>
                        <td style="width: 15px;"></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td height="10"></td>
        </tr>
    </table>


    <table class="tbs_table">
        <tr>
            <td class="tdtitle" align="left" style="width:50px;">名称：
            </td>
            <td align="left" class="tdtitle">
                <input type="text" id="txtPName" />
            </td>
            
            <td align="left" class="tdtitle">
                <input type="button" id="btnSearch" value="搜索" class="bt_wb1" onclick="GridSearch();" />
            </td>
        </tr>
    </table>
    <table id="dg">
    </table>

</asp:Content>
